package com.gulimall.gulimallproduct.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.gulimall.common.valid.ListValue;
import com.gulimall.common.valid.UpdateStatusGroup;
import com.gulimall.common.valid.addGroup;
import com.gulimall.common.valid.updateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author niujiaxing
 * @email sunlightcs@gmail.com
 * @date 2025-05-08 21:33:57
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@Null(message="新增不能指定id",groups = addGroup.class)
	@NotNull(message = "修改必须指定品牌id",groups = updateGroup.class)
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */

	@NotBlank(message = "品牌名不能为空",groups = {addGroup.class, updateGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotEmpty(groups = addGroup.class)
	@URL(message = "logo必须是一个合法的url地址",groups = {addGroup.class, updateGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	/*@TableLogic(value = "1",delval = "0")*/
	@NotNull(groups = {addGroup.class, UpdateStatusGroup.class})
	@ListValue(vals = {0,1},groups = {addGroup.class, updateGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty(groups = addGroup.class)
	@Pattern(regexp="^[a-zA-Z]$",message = "检索首字母必须是一个字母",groups = {addGroup.class, updateGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(groups = addGroup.class)
	@Min(value=0,message = "排序必须大于0",groups = {addGroup.class, updateGroup.class})
	private Integer sort;

}
